package com.lanyou.esb.web.param;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

import com.lanyou.cook.common.Constants;

public class HttpInterfaceParam {
	private String fieldId;
	private String fieldSystemId;
	private String status;
	private String auditStatus;
	private String name;
	private String code;
	private String isEnable;
	private boolean selectAll = true;
	private String id;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	private String createTime;
	private String endTime;
	
	
	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	@DateTimeFormat(pattern = Constants.DATETIME_PATTERN_1)
	private Date beginOfCreateTime;

	@DateTimeFormat(pattern = Constants.DATETIME_PATTERN_1)
	private Date endOfCreateTime;

	public Date getBeginOfCreateTime() {
		return beginOfCreateTime;
	}

	public void setBeginOfCreateTime(Date beginOfCreateTime) {
		this.beginOfCreateTime = beginOfCreateTime;
	}

	public Date getEndOfCreateTime() {
		return endOfCreateTime;
	}

	public void setEndOfCreateTime(Date endOfCreateTime) {
		this.endOfCreateTime = endOfCreateTime;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAuditStatus() {
		return auditStatus;
	}

	public void setAuditStatus(String auditStatus) {
		this.auditStatus = auditStatus;
	}

	public String getName() {
		return name==null?"":name;
	}

	public void setName(String name) {
		this.name = name;
	}

	
	public String getCode() {
		return code==null?"":code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getFieldId() {
		return fieldId==null?"":fieldId;
	}

	public void setFieldId(String fieldId) {
		this.fieldId = fieldId;
	}

	public String getFieldSystemId() {
		return fieldSystemId==null?"":fieldSystemId;
	}

	public void setFieldSystemId(String fieldSystemId) {
		this.fieldSystemId = fieldSystemId;
	}

	private String fieldName;

	private String fieldSystemName;

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	public String getFieldSystemName() {
		return fieldSystemName;
	}

	public void setFieldSystemName(String fieldSystemName) {
		this.fieldSystemName = fieldSystemName;
	}

	public String getIsEnable() {
		return isEnable;
	}

	public void setIsEnable(String isEnable) {
		this.isEnable = isEnable;
	}
	public boolean isSelectAll() {
		return selectAll;
	}

	public void setSelectAll(boolean selectAll) {
		this.selectAll = selectAll;
	}
 

	public boolean haveCondition() {
		if (StringUtils.isNotBlank(fieldId)) {
			return true;
		}
		if (StringUtils.isNotBlank(fieldSystemId)) {
			return true;
		}
		if (StringUtils.isNotBlank(status)) {
			return true;
		}
		if (StringUtils.isNotBlank(auditStatus)) {
			return true;
		}
		if (StringUtils.isNotBlank(name)) {
			return true;
		}
		if (StringUtils.isNotBlank(code)) {
			return true;
		}
		if (StringUtils.isNotBlank(isEnable)) {
			return true;
		}
		if (beginOfCreateTime != null) {
			return true;
		}
		if (endOfCreateTime != null) {
			return true;
		}
		return false;
	}


}